﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
    <LinearGradientBrush x:Key="downloadforeground_Brush" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#CC5B5B5B" Offset="1"/>
        <GradientStop Color="#B20E0E0E"/>
    </LinearGradientBrush>
    <Style x:Key="DownloadProgressBarStyle" TargetType="telerik:RadProgressBar">
        <Setter Property="Foreground" Value="{StaticResource downloadforeground_Brush}"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Maximum" Value="100"/>
        <Setter Property="Orientation" Value="Horizontal"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:RadProgressBar">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="OrientationStates">
                                <VisualState x:Name="Horizontal">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="00:00:00" Storyboard.TargetProperty="(LayoutTransformControl.LayoutTransform)" Storyboard.TargetName="transformationRoot">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <RotateTransform Angle="0"/>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Vertical">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="00:00:00" Storyboard.TargetProperty="(LayoutTransformControl.LayoutTransform)" Storyboard.TargetName="transformationRoot">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <RotateTransform Angle="-90"/>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <telerik:LayoutTransformControl x:Name="transformationRoot">
                            <Grid x:Name="Root">
                                <Border x:Name="ProgressBarTrack" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="2"/>
                                <Grid x:Name="ProgressBarRootGrid">
                                    <Grid x:Name="DeterminateRoot" Margin="1">
                                        <Rectangle x:Name="ProgressBarIndicator" Grid.Column="1" Fill="{TemplateBinding Foreground}" HorizontalAlignment="Left" Margin="{TemplateBinding BorderThickness}" RadiusY="1.5" RadiusX="1.5" StrokeThickness="0.5"/>
                                    </Grid>
                                </Grid>
                            </Grid>
                        </telerik:LayoutTransformControl>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="TimeSliderStyle" TargetType="telerik:RadSlider">
        <Setter Property="Orientation" Value="Horizontal"/>
        <Setter Property="IsEnabled" Value="True"/>
        <Setter Property="HandlesVisibility" Value="Collapsed"/>
        <Setter Property="IsMouseWheelEnabled" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:RadSlider">
                    <Grid x:Name="LayoutRoot">
                        <Grid.Resources>
                            <ResourceDictionary>
                                <DataTemplate x:Key="HorizontalTickTemplate">
                                    <Grid Height="6" Margin="0 1 0 0" Width="1">
                                        <Border BorderThickness="1 0 0 0" UseLayoutRounding="True"/>
                                    </Grid>
                                </DataTemplate>
                                <ControlTemplate x:Key="TickBarTemplate" TargetType="telerik:RadTickBar">
                                    <Canvas x:Name="LayoutRoot" Background="Transparent"/>
                                </ControlTemplate>
                                <LinearGradientBrush x:Key="MediaPlayer_Slider_InnerBackgroundThump" EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#FFFFD74E" Offset="0.996"/>
                                    <GradientStop Color="#FFFFDCAB"/>
                                    <GradientStop Color="#FFFE9227" Offset="0.51"/>
                                    <GradientStop Color="#FFFFD18F" Offset="0.5"/>
                                </LinearGradientBrush>
                                <SolidColorBrush x:Key="MediaPalyer_SliderThumb_BorderBrush" Color="Transparent"/>
                                <ControlTemplate x:Key="TimeSliderThumbTemplate" TargetType="Thumb">
                                    <Grid>
                                        <Border BorderBrush="{StaticResource MediaPalyer_SliderThumb_BorderBrush}" BorderThickness="0" Background="Transparent" CornerRadius="0"/>
                                    </Grid>
                                </ControlTemplate>
                            </ResourceDictionary>
                        </Grid.Resources>
                        <Grid x:Name="HorizontalTemplate" Height="8" MinHeight="0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Rectangle Grid.Column="1" Fill="Transparent" HorizontalAlignment="Stretch" Height="6" Grid.Row="1" Stroke="Transparent" VerticalAlignment="Stretch"/>
                            <Grid x:Name="HorizontalSingleThumbTemplate" Grid.Column="1" Grid.Row="1">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Rectangle Cursor="Hand" Grid.ColumnSpan="2" Fill="{StaticResource MediaPlayer_Slider_InnerBackgroundThump}" Height="6" Margin="1 0" RadiusY="0.5" RadiusX="0.5" VerticalAlignment="Center" Width="Auto"/>
                                <telerik:RadTickBar x:Name="TopTickBar" Grid.ColumnSpan="3" EnableSideTicks="{TemplateBinding EnableSideTicks}" Height="8" IsDirectionReversed="{TemplateBinding IsDirectionReversed}" Maximum="{TemplateBinding Maximum}" Minimum="{TemplateBinding Minimum}" Orientation="{TemplateBinding Orientation}" Placement="Top" Ticks="{TemplateBinding Ticks}" TickTemplateSelector="{TemplateBinding TickTemplateSelector}" TickTemplate="{TemplateBinding TickTemplate}" TickFrequency="{TemplateBinding TickFrequency}" Template="{StaticResource TickBarTemplate}" VerticalAlignment="Top"/>
                                <Rectangle x:Name="HorizontalSingleLargeDecrease" Fill="Transparent"/>
                                <Thumb x:Name="HorizontalSingleThumb" Grid.Column="1" Height="8" Template="{StaticResource TimeSliderThumbTemplate}" Width="17"/>
                                <Rectangle x:Name="HorizontalSingleLargeIncrease" Grid.Column="2" Fill="Transparent"/>
                            </Grid>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
